#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# 游戏主程序
import time
from games.core import *
from games.roles import *

def create(s, 头像='🙄'):
    # 静态方法
    # 如 s='信计18 亚瑟 吕布'
    l = s.split()
    name = l[0]
    heros = [hero_dict[x] for x in l[1:]]
    return Army(name, heros, 头像)

def main():
    """史诗级游戏，天王巨星张家辉代言：大渣好，我系渣渣辉...
    震撼上市。
    """
    army1 = create('信计18 亚瑟 吕布', '⛴') # 用户
    army2 = create('信计19 貂蝉 无名氏', '🚘')

    round = 100
    for _ in range(round):
        time.sleep(1)
        army1 >> army2
        army1 << army2
        if army1.isdead():
            print('军队', army1.头像, '挂了')
            break
        if army2.isdead():
            print('军队', army2.头像, '挂了')
            break
        army1.show(); army2.show()

# main()
